<?php
namespace Hr\OnlineBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

class UserType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
		
		$builder->add('gender', 'choice', array(
			'choices' => array(
				'm' => 'Male',
				'f' => 'Female'
			),
			'required'    => true,
			'expanded' => true,
		));
        $builder->add('firstName');
        $builder->add('lastName');
        $builder->add('email', 'email');
        $builder->add('password', 'password');
        $builder->add('repeatPassword', 'password');
		$builder->add('dateOfBirth', 'date', array(
			'years' => range(date('Y') - 60, date('Y') - 16),
			'format' => 'dd.MM.yyyy',
	    ));
		$builder->add('phoneMobile');
		$builder->add('phoneLandline');
		$builder->add('postcode', 'text', array('attr'=>array('size'=>6, 'class'=>'integer')));
		$builder->add('addressLine1');
		$builder->add('addressLine2');
		$builder->add('city');
		
		$builder->add('country', 'country',  array(
			'empty_data'  => null,
			'empty_value' => '-',
		)); 

		$filesTip = "DOC, DOCX, PDF";
		$builder->add('cv', 'file', array('label'=>'CV', 'required'  => false, 'attr'=> array('title'=>$filesTip)));
		$builder->add('letter', 'file', array('label'=>'Cover Letter', 'required'  => false, 'attr'=> array('title'=>$filesTip)));
		$builder->add('reference', 'file', array('label'=>'References', 'required'  => false, 'attr'=> array('title'=>$filesTip)));


    }

    public function getName()
    {
        return 'user';
    }
}